using Core.SimpleTemp.Application;
using Core.SimpleTemp.Common.Authorization;
using Core.SimpleTemp.Common.PagingQuery;
using Core.SimpleTemp.Mvc.Api.Internal;
using Core.Toolkit.Authorization;
using Core.Toolkit.Core;
using Core.Toolkit.Core.Api;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace Core.SimpleTemp.Api.Api
{
    /// <summary>
    /// 承包商_入场人员
    ///</summary>
    [ApiExplorerSettings(GroupName = "Sys")]//swagger分类标签
    [Route("api/mobile/[controller]")]//路由说明
    [EnableCors("any")]//跨域规则
    [ApiController]//APi标识Controller
    [Authorize]//验证是否登录
    public class CBS_IntoFactoryUserController : CoreApiController
    {
        private readonly CBS_IntoFactoryUserService _service;
        /// <summary>
        /// CBS_IntoFactoryUser
        ///</summary>
        public CBS_IntoFactoryUserController(CBS_IntoFactoryUserService service)
        {
            _service = service;
        }



        /// <summary>
        /// 入场
        ///</summary>
        /// <param name="dto"></param>
        /// <returns></returns>

        [HttpPost("into")]
        //[PermissionFilter(nameof(CBS_IntoFactoryUserController) + "_" + nameof(CBS_IntoFactoryUserController.IntoAsync), "入场")]
        public async Task<IActionResult> IntoAsync(CBS_IntoFactoryUserDto dto)
        {
            await _service.InsertAsync(dto);
            return this.JsonSuccess();
        }
        /// <summary>
        /// 出厂
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost("Out")]
        //[PermissionFilter(nameof(CBS_IntoFactoryUserController) + "_" + nameof(CBS_IntoFactoryUserController.OutAsync), "出厂")]
        public async Task<IActionResult> OutAsync(CBS_IntoFactoryUserDto dto)
        {
            await _service.InsertAsync(dto);
            return this.JsonSuccess();
        }



    }
}
